package ch03GuardedSuspension.a3_5;

public class Main {
    public static void main(String[] args) {
        RequestQueue requestQueue1 = new RequestQueue();
        RequestQueue requestQueue2 = new RequestQueue();
        requestQueue1.putRequest(new Request("Hello"));
        new TalkThread(requestQueue1, requestQueue2, "Alice").start();
        new TalkThread(requestQueue2, requestQueue1, "Bobby").start();
    }
}
/*
Alice:BEGIN
Bobby:BEGIN
Alice gets  [ Request Hello ]
Alice puts  [ Request Hello! ]
Bobby gets  [ Request Hello! ]
Bobby puts  [ Request Hello!! ]
Alice gets  [ Request Hello!! ]
Alice puts  [ Request Hello!!! ]
Bobby gets  [ Request Hello!!! ]
Bobby puts  [ Request Hello!!!! ]
Alice gets  [ Request Hello!!!! ]
Alice puts  [ Request Hello!!!!! ]
Bobby gets  [ Request Hello!!!!! ]
Bobby puts  [ Request Hello!!!!!! ]
Alice gets  [ Request Hello!!!!!! ]
Alice puts  [ Request Hello!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Alice:END
Bobby gets  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby puts  [ Request Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]
Bobby:END

 */